function [out] = alternatedemap(inp)
angle11 = pi;
angle00 = -pi/2;
angle01 = pi/2;
angle10 = pi;
angle_inp = angle(inp);
if((angle_inp >= 0) && (angle_inp <= pi/2))
    out = (1.*exp(1i*angle01))*inp;
elseif((angle_inp >= pi/2) && (angle_inp <= pi))
    out = (1.*exp(-1i*angle10))*inp;
elseif((angle_inp <= 0) && (angle_inp >= -pi/2))
    out = (1.*exp(1i*angle00))*inp;
elseif((angle_inp >= -pi) && (angle_inp <= -pi/2))
    out = (1.*exp(1i*angle11))*inp;
end